# 自定义函数
# 通过ID查找
# 查找 look up
#
# coding:utf8

def search_by_ID(stulist, ID):
    for i in range(len(stulist)):
        if stulist[i].ID == ID:
            print(u"姓名：", )
            print(stulist[i].name, )
            print("\t", )
            print(u"学号:", )
            print(stulist[i].ID, )
            print("\t", )
            print(u"分数:", )
            print(stulist[i].score)
            return True
    return False


# 自定义函数
# 通过'姓名'查找
def search_by_name(stulist, name):
    for i in range(len(stulist)):
        if i is name:
            print(u'姓名:', )
            print(stulist[i].name, )
            print("\t", )
            print(u'学号')
            print(stulist[i].ID, )
            print("\t", )
            print(u"分数:", )
            print(stulist[i].score)
            return True
        else:
            return False
